package com.smart.campus.controller;

import com.smart.campus.dto.ShStudent;
import com.smart.campus.interfaces.ShStudentServiceApi;
import com.smart.campus.pojo.PagedResponse;
import com.smart.campus.service.ShStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;


@RestController
public class ShStudentController implements ShStudentServiceApi {
    @Autowired
    private ShStudentService shStudentService;

    @Override
    public PagedResponse<ShStudent> pageShStudent(ShStudent shStudent, Integer pageNum, Integer pageSize) {
        return shStudentService.pageShStudent(shStudent,pageNum,pageSize);
    }

    @Override
    public void addShStudent(ShStudent shStudent) {
        shStudentService.addShStudent(shStudent);
    }

    @Override
    public void delShStudent(Integer id) {
        shStudentService.delShStudent(id);
    }

    @Override
    public ShStudent findShStudentById(Integer id) {
        return shStudentService.findShStudentById(id);
    }

    @Override
    public void updateDateShStudent(ShStudent shStudent) {
        shStudentService.updateDateShStudent(shStudent);
    }

    /**
     * 导出
     * @param shStudent
     * @return
     */
    @Override
    public List<ShStudent> findShStudentList(ShStudent shStudent) {
        return shStudentService.findShStudentList(shStudent);
    }

    /**
     * 导入
     * @param file
     */
    @Override
    public void importExcel(MultipartFile file) throws Exception {
        shStudentService.importExcel(file);
    }
}
